package sctu.edu.java.year2016.team04.guoyicheng.day20160525.chapter7_2;

/**
 * Created by yicheng on 2016/5/25.
 * 尝试编写一个矩形类，矩形的长宽作为矩形类的属性，在构造方法中将长、宽初始化，定义一个成员方法求矩形的面积。
 */
public class Rectangle {

    public static void main(String[] args) {

        Rectangle1 guo = new Rectangle1();

        guo.Voluation(2, 3);

        System.out.println("矩形的面积为："+guo.chengfa());
    }
}


class Rectangle1 {

    int Long;
    int Wide;


    public void Voluation(int Long, int Wide) {

        this.Long = Long;
        this.Wide = Wide;

    }
    public int chengfa(){
        return Long*Wide;
    }
}